package com.example.config;

import org.springframework.amqp.core.ReturnedMessage;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

@Component
public class ReturnsCallBackImpl implements RabbitTemplate.ReturnsCallback {
    @Override
    public void returnedMessage(ReturnedMessage returnedMessage) {
        System.out.println("returnedMessage = " + returnedMessage);
        System.out.println("returnedMessage.getMessage() = " + returnedMessage.getMessage());
        System.out.println("returnedMessage.getReplyCode() = " + returnedMessage.getReplyCode());
        System.out.println("returnedMessage.getReplyText() = " + returnedMessage.getReplyText());
        System.out.println("returnedMessage.getExchange() = " + returnedMessage.getExchange());
        System.out.println("returnedMessage.getRoutingKey() = " + returnedMessage.getRoutingKey());

    }
}
